﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny.UI;

namespace SmartMotion.Core.Tools
{
    public partial class FrmSelectVar : UIForm
    {
        private readonly MethodParms _methodParms;
        public FrmSelectVar(MethodParms methodParms)
        {
            _methodParms = methodParms;
            InitializeComponent();
        }

        private void FrmSelectVar_Load(object sender, EventArgs e)
        {
            GlobalVars.Ins.ComboTreeLoadData(cmbTree,_methodParms.Type);
            cmbTree.Text = _methodParms.VarName;
        }

        private void cmbTree_NodeSelected(object sender, TreeNode node)
        {
            _methodParms.VarName = node.Text;
            _methodParms.VarGuid = node.Tag.ToString();
            _methodParms.Value= GlobalVars.Ins.GetVar(_methodParms.VarGuid).Value;
        }


    }       
}   
